package usw.webserver.entity;

/**
 *
 *
 */
public class Status {
	
	//	100+
	public static final int	STATUS_100 = 100;
	public static final int STATUS_101 = 101;
	
	//	200+
	public static final int STATUS_200 = 200;
	public static final int STATUS_201 = 201;
	public static final int STATUS_202 = 202;
	public static final int STATUS_203 = 203;
	public static final int STATUS_204 = 204;
	public static final int STATUS_205 = 205;
	public static final int STATUS_206 = 206;
	
	//	300+
	public static final int STATUS_300 = 300;
	public static final int STATUS_301 = 301;
	public static final int STATUS_302 = 302;
	public static final int STATUS_303 = 303;
	public static final int STATUS_304 = 304;
	public static final int STATUS_305 = 305;
	public static final int STATUS_306 = 306;
	public static final int STAUTS_307 = 307;
	
	//	400+
	public static final int STATUS_400 = 400;
	public static final int STATUS_401 = 401;
	public static final int STATUS_402 = 402;
	public static final int STATUS_403 = 403;
	public static final int STATUS_404 = 404;
	public static final int STATUS_405 = 405;
	public static final int STATUS_406 = 406;
	public static final int STAUTS_407 = 407;
	public static final int STATUS_408 = 408;
	public static final int STATUS_409 = 409;
	public static final int STATUS_410 = 410;
	public static final int STATUS_411 = 411;
	public static final int STATUS_412 = 412;
	public static final int STATUS_413 = 413;
	public static final int STATUS_414 = 414;
	public static final int STAUTS_415 = 415;	
	public static final int STATUS_416 = 416;
	public static final int STAUTS_417 = 417;
	
	//	500+
	public static final int STATUS_500 = 500;
	public static final int STATUS_501 = 501;
	public static final int STATUS_502 = 502;
	public static final int STATUS_503 = 503;
	public static final int STATUS_504 = 504;
	public static final int STATUS_505 = 505;
	
	
	//-----------------------------------------------
	
	public static final String STR_STATUS_100 = "100 Continue"; 
	public static final String STR_STATUS_101 = "101 Switching Protocols";
	public static final String STR_STATUS_200 = "200 OK";
	public static final String STR_STATUS_201 = "201 Created";
	public static final String STR_STATUS_202 = "202 Accepted";
	public static final String STR_STATUS_203 = "203 Non-Authoritative Information";
	public static final String STR_STATUS_204 = "204 No Content";
	public static final String STR_STATUS_205 = "205 Reset Content";
	public static final String STR_STATUS_206 = "206 Partial Content";

	public static final String STR_STATUS_300 = "300 Multiple Choices";
	public static final String STR_STATUS_301 = "301 Moved Permanently";
	public static final String STR_STATUS_302 = "302 Found";
	public static final String STR_STATUS_303 = "303 See Other";
	public static final String STR_STATUS_304 = "303 See Other";
	public static final String STR_STATUS_305 = "304 Not Modified";
	public static final String STR_STATUS_306 = "305 Use Proxy";
	public static final String STR_STAUTS_307 = "307 Temporary Redirect";

	public static final String STR_STATUS_400 = "400 Bad Request";
	public static final String STR_STATUS_401 = "401 Unauthorized";
	public static final String STR_STATUS_402 = "402 Payment Required";
	public static final String STR_STATUS_403 = "403 Forbidden";
	public static final String STR_STATUS_404 = "404 Not Found";
	public static final String STR_STATUS_405 = "405 Method Not Allowed";
	public static final String STR_STATUS_406 = "406 Not Acceptable";
	public static final String STR_STAUTS_407 = "407 Proxy Authentication Required";
	public static final String STR_STATUS_408 = "408 Request Time-out";
	public static final String STR_STATUS_409 = "409 Conflict";
	public static final String STR_STATUS_410 = "410 Gone";
	public static final String STR_STATUS_411 = "411 Length Required";
	public static final String STR_STATUS_412 = "412 Precondition Failed";
	public static final String STR_STATUS_413 = "413 Request Entity Too Large";
	public static final String STR_STATUS_414 = "414 Request-URI Too Large";
	public static final String STR_STAUTS_415 = "415 Unsupported Media Type";
	public static final String STR_STATUS_416 = "416 Requested range not satisfiable";
	public static final String STR_STAUTS_417 = "417 Expectation Failed";
	
	public static final String STR_STATUS_500 = "500 Internal Server Error"; 
	public static final String STR_STATUS_501 = "501 Not Implemented";
	public static final String STR_STATUS_502 = "502 Bad Gateway";
	public static final String STR_STATUS_503 = "503 Service Unavailable";
	public static final String STR_STATUS_504 = "504 Gateway Time-out";
	public static final String STR_STATUS_505 = "505 HTTP Version not supported";

	public Status(int nStatus)
	{
		setnStatus(nStatus);
	}
	
	//-----------------------------------------------
	
	private String 	strStatus = "";
	private int		nStatus;

	public void setnStatus(int nStatus) {
		this.nStatus = nStatus;
		
		switch(this.nStatus)
		{
			case	STATUS_100: { strStatus = "100 Continue"; } break;
			
			case	STATUS_101: { strStatus = "101 Switching Protocols"; } break;
			case	STATUS_200: { strStatus = "200 OK"; } break;
			case	STATUS_201: { strStatus = "201 Created"; } break;
			case	STATUS_202: { strStatus = "202 Accepted"; } break;
			case	STATUS_203: { strStatus = "203 Non-Authoritative Information"; } break;
			case	STATUS_204: { strStatus = "204 No Content"; } break;
			case	STATUS_205: { strStatus = "205 Reset Content"; } break;
			case	STATUS_206: { strStatus = "206 Partial Content"; } break;
			
			case	STATUS_300: { strStatus = "300 Multiple Choices"; } break;
			case	STATUS_301: { strStatus = "301 Moved Permanently"; } break;
			case	STATUS_302: { strStatus = "302 Found"; } break;
			case	STATUS_303: { strStatus = "303 See Other"; } break;
			case	STATUS_304: { strStatus = "303 See Other"; } break;
			case	STATUS_305: { strStatus = "304 Not Modified"; } break;
			case	STATUS_306: { strStatus = "305 Use Proxy"; } break;
			case	STAUTS_307: { strStatus = "307 Temporary Redirect"; } break;
			
			case	STATUS_400: { strStatus = "400 Bad Request"; } break;
			case	STATUS_401: { strStatus = "401 Unauthorized"; } break;
			case	STATUS_402: { strStatus = "402 Payment Required"; } break;
			case	STATUS_403: { strStatus = "403 Forbidden"; } break;
			case	STATUS_404: { strStatus = "404 Not Found"; } break;
			case	STATUS_405: { strStatus = "405 Method Not Allowed"; } break;
			case	STATUS_406: { strStatus = "406 Not Acceptable"; } break;
			case	STAUTS_407: { strStatus = "407 Proxy Authentication Required"; } break;
			case	STATUS_408: { strStatus = "408 Request Time-out"; } break;
			case	STATUS_409: { strStatus = "409 Conflict"; } break;
			case	STATUS_410: { strStatus = "410 Gone"; } break;
			case	STATUS_411: { strStatus = "411 Length Required"; } break;
			case	STATUS_412: { strStatus = "412 Precondition Failed"; } break;
			case	STATUS_413: { strStatus = "413 Request Entity Too Large"; } break;
			case	STATUS_414: { strStatus = "414 Request-URI Too Large"; } break;
			case	STAUTS_415: { strStatus = "415 Unsupported Media Type"; } break;
			case	STATUS_416: { strStatus = "416 Requested range not satisfiable"; } break;
			case	STAUTS_417: { strStatus = "417 Expectation Failed"; } break;
			
			case	STATUS_500: { strStatus = "500 Internal Server Error"; } break;
			case	STATUS_501: { strStatus = "501 Not Implemented"; } break;
			case	STATUS_502: { strStatus = "502 Bad Gateway"; } break;
			case	STATUS_503: { strStatus = "503 Service Unavailable"; } break;
			case	STATUS_504: { strStatus = "504 Gateway Time-out"; } break;
			case	STATUS_505: { strStatus = "505 HTTP Version not supported"; } break;
			default:            { strStatus = "Unknown status"; } break;
		}
	}

	@Override
	public String toString() {
		return strStatus;
	}
}
